// app.js
import vxios from "@gatomis/vxios";
let url = 'http://106.52.150.170:8001/'
vxios.defaults.baseURL = url;
App({
    globalData: {
        iconUrlHead: "https://www.xqstudy.top/CSPD/",
        isLogin: false,
        size: 10, //分页中每页的大小
        baseUrl: url,
        vxios: vxios,
        isLogin: true,
        token: "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6MjAsImV4cCI6MTY2ODI3MzE4OX0.un2yeNnFwxYntMXHERrZyfnHrV0vMpsL_B4rFGtIJmI",
        userInfo: {
            avatar: "../../images/tabbar/tab_mine.png",
            username: "您还未登录",
            realName: "",
            id: "20",
        },
        LoginFist: () => {
            wx.showToast({
                title: '请先登录',
                icon: 'error',
                duration: 3000
            })
        }
    },
    onLaunch() {
        let token = wx.getStorageSync("token");
        if (token) {
            this.globalData.token = token;
            this.globalData.isLogin = true;
        }

    }
})